package com.ruoyi.workload.mapper;

import com.ruoyi.workload.domain.entity.WorkLoad;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WorkLoadMapper {

    @Select("select * from work_load")
    List<WorkLoad> getworkLoadList();

    @Results(id="workLoadMap",value = {
            @Result(property = "dependTime", column = "depend_time"),
            @Result(property = "workTime", column = "work_time"),
            @Result(property = "workDate", column = "work_date")
    })
    @Select("<script>" +
            "select * from work_load"+
            " where 1=1 "+
            " and work_date between #{startDateDate} and #{endDate}"+
            "<if test='npi != null and npi != \"\"'>" +
            " and npi=#{npi}"+
            "</if>"+
            "<if test='project != null and project != \"\"'>" +
            " and project=#{project}"+
            "</if>"+
            "</script>")
    List<WorkLoad> getWorkLoadListByIdAndProject(@Param("startDateDate") String startDateDate,@Param("endDate") String endDate,@Param("npi") String npi,@Param("project") String project);
}
